<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="LocalConnectionManager,com.vivisectingmedia.framework.utils.LocalConnectionManager,connection,connectionTarget,currentConnectionName,addDomain,handleAsyncEvent,handleStatusEvent,sendMessage" name="keywords">
<title>com.vivisectingmedia.framework.utils.LocalConnectionManager</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'LocalConnectionManager - Vivisecting Media Framework API';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?com/vivisectingmedia/framework/utils/LocalConnectionManager.html&amp;com/vivisectingmedia/framework/utils/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;LocalConnectionManager</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class LocalConnectionManager"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.vivisectingmedia.framework.utils</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class LocalConnectionManager</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">LocalConnectionManager <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../images/inherit-arrow.gif"> flash.events.EventDispatcher</td>
</tr>
</table>
<p></p>
  The LocalConnectionManager provides a simpler interface to the Flash LocalConnection that is designed to support
  retention of Class type when communication with other ActionScript 3 Applications.  For Class retention to work
  both Application must contain the custom class.  If the class does not existing in the receiving Application an
  error event will be dispatched.
  
  <p>To use this utility create a new instance of the Class providing the target Object that methods send from another 
  LocalConnection should be applied to, create a connection to expose this application to other LCM enabled applications
  and then brodacast messages with sendMessage() method. </p>
  
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a><a name="protectedPropertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Properties</div>
<table id="summaryTableProtectedProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#connection">connection</a> : LocalConnection<div class="summaryTableDescription">
  Stores the LC instance for the Class.</div>
</td><td class="summaryTableOwnerCol">LocalConnectionManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#connectionTarget">connectionTarget</a> : Object<div class="summaryTableDescription">
  Stores the connection target object that should be called when a message from the LC is received.</div>
</td><td class="summaryTableOwnerCol">LocalConnectionManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#currentConnectionName">currentConnectionName</a> : String<div class="summaryTableDescription">
  Stores the connection name for the current application for communication.</div>
</td><td class="summaryTableOwnerCol">LocalConnectionManager</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#LocalConnectionManager()">LocalConnectionManager</a>(connTarget:Object, connectionName:String, domainList:Array = null, eventTarget:IEventDispatcher = null)</div>
<div class="summaryTableDescription">
   Constructor.</div>
</td><td class="summaryTableOwnerCol">LocalConnectionManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addDomain()">addDomain</a>(domainArray:Array):void</div>
<div class="summaryTableDescription">
   Updates the approved domain list on the LocalConnection.</div>
</td><td class="summaryTableOwnerCol">LocalConnectionManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#sendMessage()">sendMessage</a>(target:String, methodName:String, ... args):void</div>
<div class="summaryTableDescription">
   Calls the application via the target name and method defined in the arguments.</div>
</td><td class="summaryTableOwnerCol">LocalConnectionManager</td>
</tr>
</table>
</div>
<a name="protectedMethodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Methods</div>
<table id="summaryTableProtectedMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#handleAsyncEvent()">handleAsyncEvent</a>(event:AsyncErrorEvent):void</div>
<div class="summaryTableDescription">
   Used to track Async errors from the LC instance.</div>
</td><td class="summaryTableOwnerCol">LocalConnectionManager</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#handleStatusEvent()">handleStatusEvent</a>(event:StatusEvent):void</div>
<div class="summaryTableDescription">
   Used to track Status events from the LC instance.</div>
</td><td class="summaryTableOwnerCol">LocalConnectionManager</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="connection"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">connection</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>protected var connection:LocalConnection</code><p>
  Stores the LC instance for the Class.
  </p></div>
<a name="connectionTarget"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">connectionTarget</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected var connectionTarget:Object</code><p>
  Stores the connection target object that should be called when a message from the LC is received.
  </p></div>
<a name="currentConnectionName"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">currentConnectionName</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected var currentConnectionName:String</code><p>
  Stores the connection name for the current application for communication.
  </p></div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="LocalConnectionManager()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">LocalConnectionManager</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function LocalConnectionManager(connTarget:Object, connectionName:String, domainList:Array = null, eventTarget:IEventDispatcher = null)</code><p>
   Constructor.  Creates a new instance of a LCM and establishes the LocalConnection instance during construction.
   
   </p><p>The constructor also opens the application for communication with other LCM enabled applications based on the name provided.  For other LCM
   enabled apps to successfully communicate the app must be on an approved domain and know the name that is defined for
   this application. Only one application at a time can be connected via the provided name.  If an application is already
   connected via this name the LCM will dispatch a LocalConnectionEvent.CONNECTION_ERROR.  If a connection name is not provided then
   the two error communication will not be able to function, this is why the argument is required.</p>
   
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">connTarget</span>:Object</code> &mdash; This is the object that LC message calls are applied to when received from another applicaiton.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">connectionName</span>:String</code> &mdash; The application communication name
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">domainList</span>:Array</code> (default = <code>null</code>)<code></code> &mdash; An array of domains to allow communication with the LC, if no value is set the default is '. 
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">eventTarget</span>:IEventDispatcher</code> (default = <code>null</code>)<code></code> &mdash; See EventDispatcher for full details.
   
   </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addDomain()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addDomain</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function addDomain(domainArray:Array):void</code><p>
   Updates the approved domain list on the LocalConnection.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">domainArray</span>:Array</code> &mdash; A list of strings that represent the allowed domains.
   
   </td>
</tr>
</table>
</div>
<a name="handleAsyncEvent()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">handleAsyncEvent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function handleAsyncEvent(event:AsyncErrorEvent):void</code><p>
   Used to track Async errors from the LC instance.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">event</span>:AsyncErrorEvent</code> &mdash; AsyncEvent thrown by the LC.
   
   </td>
</tr>
</table>
</div>
<a name="handleStatusEvent()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">handleStatusEvent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function handleStatusEvent(event:StatusEvent):void</code><p>
   Used to track Status events from the LC instance.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">event</span>:StatusEvent</code> &mdash; Status event from the LC.
   
   </td>
</tr>
</table>
</div>
<a name="sendMessage()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">sendMessage</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function sendMessage(target:String, methodName:String, ... args):void</code><p>
   Calls the application via the target name and method defined in the arguments.  This method retains the Class definitions
   and marks the arguments according to their type so that the receiving application can re-cast back to the correct Class. The
   receiving application must have the same defined type and the method argument count must match both order and type in order
   for the call to be successfully completed.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">target</span>:String</code> &mdash; The name of the application exposed via connectionName to call the method on.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">methodName</span>:String</code> &mdash; The method to call on the target application.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code>... <span class="label">args</span></code> &mdash; Common seperated argument values for the defined method.
   
   </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">Portions created by James Polanco are Copyright (C) 2008 James Polanco. All Rights Reserved.</center>
</div>
</body>
</html>
<!--Portions created by James Polanco are Copyright (C) 2008 James Polanco. All Rights Reserved.-->
